import { ref } from "vue";
import { useRouter } from "vue-router";
const useCenter = () => {
  const router = useRouter();
  const isActiveRoute = ref("");
  const isTitle = ref("");
  const toAnyRoute = (routeName: string) => {
    switch (routeName) {
      case "My_member":
        router.push({ name: "My_member" });
        isTitle.value = "我的会员";
        break;
      case "Wallet":
        router.push({ name: "Wallet" });
        isTitle.value = "我的钱包";
        break;
      case "Coupons":
        router.push({ name: "Coupons" });
        isTitle.value = "我的优惠券";
        break;
      case "Dynamics":
        router.push({ name: "Dynamics" });
        isTitle.value = "我的资源";
        break;
    }
  };
  return { toAnyRoute };
};
export default useCenter;
